package com.db.service;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DataSource {
    private String connectionUrl;
    private String connectionUser;
    private String connectionPassword;

    public DataSource(String connectionUrl, String connectionUser, String connectionPassword) {
        this.connectionUrl = connectionUrl;
        this.connectionUser = connectionUser;
        this.connectionPassword = connectionPassword;
    }

    public Connection getConnection() {
        Connection connection = null;
        try {
            connection = DriverManager.getConnection(connectionUrl, connectionUser, connectionPassword);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return connection;
    }
}
